<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">

	// location.replace("http://www.baidu.com")
		// console.log(history)

	// var name = "学并思";

	// alert(name);
	// 
	function run () {
		var nowObj = new Date();
		var nowtime = nowObj.getTime()/1000;
		var now = Math.round(nowtime);

		var ydObj = new Date("2018-01-01 0:0:0");
		var ydtime = ydObj.getTime()/1000;
		var yd = Math.round(ydtime);

		var diff = yd-now;

		var day = Math.floor(diff/86400);

		var yushu = diff%86400;

		var hours =  Math.floor(yushu/3600);

		var yushu = yushu%3600;

		var min =  Math.floor(yushu/60);

		var second =  yushu%60;

		document.write(day+"天"+hours+"小时"+min+"分钟"+second+"秒"+"<br>");
	}

	setInterval(run,2000);
	// setTimeout(run,2000);
	// setInterval(func, interval[, args])

	</script>
</head>
<body>
	
</body>
</html>